<?php
$mobile = _POST('mobile', '');
mobile_filter($mobile) || abort('无效手机号!');
$code = substr(md5(time()), rand(0, 26), 6);
try
{
    if (send_sms_reg($mobile, $code))
    {
        return [];
    }
    abort('未知错误!');
}
catch (Exception $e)
{
    abort($e->getMessage());
}